<script setup lang="ts">
import { computed, PropType } from "vue";
import { parknflyStaticParkEntryConfig } from "../utils/hook";

defineOptions({
  name: "xiaoQiangStatisticsEntryCard"
});

interface CardProductType {
  type: number;
  isSetup: boolean;
  description: string;
  name: string;
}

const props = defineProps({
  product: {
    type: Object as PropType<CardProductType>
  }
});

const cardClass = computed(() => [
  "list-card-item",
  { "list-card-item__disabled": true }
]);

const { jump } = parknflyStaticParkEntryConfig();
</script>

<template>
  <div :class="cardClass">
    <div
      class="list-card-item_detail bg-bg_color"
      @click="jump(product.search_date)"
    >
      <p class="list-card-item_detail--name text-text_color_primary">
        <!--日期-->
        {{ product.date }}
      </p>
      <p class="list-card-item_detail--operation text-text_color_regular">
        <!--数量-->
        {{ product.count }}辆
      </p>
    </div>
  </div>
</template>

<style scoped lang="scss">
.list-card-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 3px;

  &_detail {
    flex: 1;
    min-height: 140px;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    &--logo {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 56px;
      height: 56px;
      font-size: 32px;
      color: #0052d9;
      background: #e0ebff;
      border-radius: 50%;

      &__disabled {
        color: #a1c4ff;
      }
    }

    &--operation {
      display: flex;
      height: 100%;
      margin-top: 24px;
      &--tag {
        border: 0;
      }
    }

    &--name {
      margin: 0 0 8px;
      font-size: 16px;
      font-weight: 400;
    }
  }

  &__disabled {
    .list-card-item_detail--name,
    .list-card-item_detail--desc {
      color: #333;
      font-weight: 700;
    }

    .list-card-item_detail--operation--tag {
      color: #666;
    }
  }
}
.el-col:nth-child(n + 1):nth-child(-n + 6):nth-child(2n)
  .list-card-item
  .list-card-item_detail {
  background: #f8f9ff;
}
.el-col:nth-child(n + 7):nth-child(-n + 12):nth-child(2n-1)
  .list-card-item
  .list-card-item_detail {
  background: #f8f9ff;
}
.el-col:nth-child(n + 13):nth-child(-n + 18):nth-child(2n)
  .list-card-item
  .list-card-item_detail {
  background: #f8f9ff;
}
.el-col:nth-child(n + 19):nth-child(-n + 24):nth-child(2n-1)
  .list-card-item
  .list-card-item_detail {
  background: #f8f9ff;
}
.el-col:nth-child(n + 25):nth-child(-n + 30):nth-child(2n)
  .list-card-item
  .list-card-item_detail {
  background: #f8f9ff;
}
</style>
